home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / sun / volume1 / tooltool2.1c / part08 < prev    next >
Encoding:
Internet Message Format  |  1989-06-06  |  30.9 KB

  1. Path: uunet!husc6!rutgers!aramis.rutgers.edu!dartagnan.rutgers.edu!mcgrew
  2. From: mcgrew@dartagnan.rutgers.edu (Charles Mcgrew)
  3. Newsgroups: comp.sources.sun
  4. Subject: v01i027:  Tooltool - a suntools user interface builder, Part08/13
  5. Message-ID: <Jun.7.00.22.06.1989.23633@dartagnan.rutgers.edu>
  6. Date: 7 Jun 89 04:22:08 GMT
  7. Organization: Rutgers Univ., New Brunswick, N.J.
  8. Lines: 1058
  9. Approved: mcgrew@aramis.rutgers.edu
  10.  
  11. Submitted-by: Chuck Musciano <chuck@trantor.harris-atd.com>
  12. Posting-number: Volume 1, Issue 27
  13. Archive-name: tooltool2.1c/part08
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 8 (of 13)."
  22. # Contents:  parse.y
  23. # Wrapped by chuck@melmac on Thu Jun  1 10:39:34 1989
  24. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  25. if test -f 'parse.y' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'parse.y'\"
  27. else
  28. echo shar: Extracting \"'parse.y'\" \(28618 characters\)
  29. sed "s/^X//" >'parse.y' <<'END_OF_FILE'
  30. X/************************************************************************/
  31. X/*    Copyright 1988 by Chuck Musciano and Harris Corporation        */
  32. X/*                                    */
  33. X/*    Permission to use, copy, modify, and distribute this software    */
  34. X/*    and its documentation for any purpose and without fee is    */
  35. X/*    hereby granted, provided that the above copyright notice    */
  36. X/*    appear in all copies and that both that copyright notice and    */
  37. X/*    this permission notice appear in supporting documentation, and    */
  38. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  39. X/*    used in advertising or publicity pertaining to distribution    */
  40. X/*    of the software without specific, written prior permission.    */
  41. X/*    Chuck Musciano and Harris Corporation make no representations    */
  42. X/*    about the suitability of this software for any purpose.  It is    */
  43. X/*    provided "as is" without express or implied warranty.        */
  44. X/*                                    */
  45. X/*    The sale of any product based wholely or in part upon the     */
  46. X/*    technology provided by tooltool is strictly forbidden without    */
  47. X/*    specific, prior written permission from Harris Corporation.    */
  48. X/*    Tooltool technology includes, but is not limited to, the source    */
  49. X/*    code, executable binary files, specification language, and    */
  50. X/*    sample specification files.                    */
  51. X/************************************************************************/
  52. X
  53. X
  54. X%{
  55. X
  56. X#include    <stdio.h>
  57. X#include    <ctype.h>
  58. X
  59. X#include    "tooltool.h"
  60. X
  61. XPUBLIC    Menu    ttymenu_proc();
  62. X
  63. XPRIVATE    int    line_count = 1;
  64. XPRIVATE    int    curr_key, curr_key_set;
  65. XPRIVATE    g_ptr    curr_gadget = NULL;
  66. XPRIVATE    d_ptr    curr_window = NULL;
  67. XPRIVATE    char    ungetc = -1;
  68. X
  69. X%}
  70. X
  71. X%start    tool_spec
  72. X
  73. X%union    {a_ptr        aval;
  74. X     int        ival;
  75. X     char        *cpval;
  76. X     cv_ptr        cvval;
  77. X     e_ptr        eval;
  78. X     g_ptr        gval;
  79. X     l_ptr        lval;
  80. X     Menu        mval;
  81. X     Menu_item    mival;
  82. X     double        rval;
  83. X    }
  84. X
  85. X%token    <cpval>    ICON_STRING ID STRING
  86. X%token    <ival>    INTEGER
  87. X%token    <rval>    REAL
  88. X%token    <ival>    L2 L3 L4 L5 L6 L7 L8 L9 L10 F1 F2 F3 F4 F5 F6 F7 F8 F9 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15
  89. X
  90. X%token        AND ASSIGN_AND ASSIGN_DIVIDE ASSIGN_MINUS ASSIGN_MODULO ASSIGN_OR ASSIGN_PLUS
  91. X%token        ASSIGN_TIMES ASSIGN_XOR ASSIGNMENT COLON COMMA COMPLEMENT DECREMENT DIVIDE EQUAL
  92. X%token        GREATER GREATER_EQUAL INCREMENT LBRACE LBRACK LEFT_SHIFT LESS LESS_EQUAL
  93. X%token        LOGICAL_AND LOGICAL_NOT LOGICAL_OR LPAREN MINUS MODULO NOT_EQUAL OR PLUS
  94. X%token        QUESTION RBRACE RBRACK RIGHT_SHIFT RPAREN SEMICOLON TIMES XOR
  95. X
  96. X%token        ACTION ALIGN APPLICATION AT BASE BEEP BOTTOM BREAK BUTTON BY CENTER
  97. X%token        CHARACTERS CHOICE CLOSE COMPLETION CONTINUE CONTROL CURRENT CYCLE DIALOG DISABLE
  98. X%token        DISPLAY ELSE END_BUTTON END_CHOICE END_DIALOG END_GADGETS END_KEY END_KEYS
  99. X%token        END_LABEL END_MENU END_MOUSE END_SLIDER END_TEXT EXIT FONT FOR
  100. X%token        FUNCTION_KEYS GADGETS HORIZONTAL ICON IF IGNORE INITIAL INITIALIZE
  101. X%token        KEY KEYS LABEL LEFT MARK MAXIMUM MENU META MIDDLE MINIMUM MOUSE
  102. X%token        NOMARK NORMAL NORMAL_KEYS NOTHING OFF ON OPEN PIXELS POPUP
  103. X%token        PROPORTIONAL RAGGED RANGE REMOVE RETAIN RIGHT SEND SHIFT SIZE
  104. X%token        SLIDER TEXT TIMER TOP TRIGGER TTYMENU VALUE VERTICAL WHILE WIDTH
  105. X
  106. X%type    <aval>    action action_list open close initialize timer
  107. X%type    <ival>    size_unit shifts key_name button_name align
  108. X%type    <cpval>    label font icon optional_name
  109. X%type    <cvval>    choice_list
  110. X%type    <eval>    array_ref expr factor optional_expr
  111. X%type    <gval>    gadgets gadget_list gadget button_gadget choice_gadget
  112. X        label_gadget menu_gadget slider_gadget text_gadget
  113. X%type    <lval>    icon_label
  114. X%type    <mval>    menu menu_value
  115. X%type    <mival>    menu_entry
  116. X
  117. X%left    ACTION
  118. X%left    ELSE
  119. X%left    EXPR
  120. X%left    SEMICOLON
  121. X%left    ARRAY_REF
  122. X
  123. X%right    ASSIGNMENT ASSIGN_AND ASSIGN_DIVIDE ASSIGN_MINUS ASSIGN_MODULO ASSIGN_OR ASSIGN_PLUS ASSIGN_TIMES ASSIGN_XOR
  124. X%left    COMMA
  125. X%right    QUESTION COLON
  126. X%left    LOGICAL_OR
  127. X%left    LOGICAL_AND
  128. X%left    OR
  129. X%left    XOR
  130. X%left    AND
  131. X%left    EQUAL NOT_EQUAL
  132. X%left    LESS LESS_EQUAL GREATER GREATER_EQUAL
  133. X%left    LEFT_SHIFT RIGHT_SHIFT
  134. X%left    PLUS MINUS
  135. X%left    TIMES DIVIDE MODULO
  136. X%right    DECREMENT INCREMENT UMINUS COMPLEMENT LOGICAL_NOT
  137. X%left    LPAREN RPAREN
  138. X
  139. X%%
  140. X
  141. Xtool_spec    :    APPLICATION STRING
  142. X                    { curr_window = tt_base_window; }
  143. X            appl_attr gadgets dialogs keys mouse
  144. X                    { tt_application = $2;
  145. X                      tt_base_window->gadgets = $5;
  146. X                      tt_base_window->is_base_frame = TRUE;
  147. X                    }
  148. X        ;
  149. X
  150. Xappl_attr    :    empty
  151. X        |    appl_attr size
  152. X        |    appl_attr position
  153. X        |    appl_attr icon
  154. X                    { if (tt_icon == NULL)
  155. X                         tt_icon = $2;
  156. X                      else
  157. X                         yyerror("Conflicting application icon specifications");
  158. X                    }
  159. X        |    appl_attr label
  160. X                    { if (curr_window->label == NULL)
  161. X                         curr_window->label = $2;
  162. X                      else
  163. X                         yyerror("Conflicting window label specifications");
  164. X                    }
  165. X        |    appl_attr font
  166. X                    { if (tt_a_font == tt_default_font)
  167. X                         tt_a_font = tt_open_font($2);
  168. X                      else
  169. X                         yyerror("Conflicting application font specifications");
  170. X                    }
  171. X        |    appl_attr open
  172. X                    { if (curr_window->open_action == NULL)
  173. X                         curr_window->open_action = $2;
  174. X                      else
  175. X                         yyerror("Conflicting window opening strings");
  176. X                    }
  177. X        |    appl_attr close
  178. X                    { if (curr_window->close_action == NULL)
  179. X                         curr_window->close_action = $2;
  180. X                      else
  181. X                         yyerror("Conflicting window closing strings");
  182. X                    }
  183. X        |    appl_attr initialize
  184. X                    { if (tt_initial_action == NULL)
  185. X                         tt_initial_action = $2;
  186. X                      else
  187. X                         yyerror("Conflicting initial command strings");
  188. X                    }
  189. X        |    appl_attr timer
  190. X                    { if (tt_timer_action == NULL)
  191. X                         tt_timer_action = $2;
  192. X                      else
  193. X                         yyerror("Conflicting timer command strings");
  194. X                    }
  195. X        ;
  196. X
  197. Xsize        :    SIZE INTEGER BY INTEGER size_unit
  198. X                    { curr_window->rows = $2;
  199. X                      curr_window->columns = $4;
  200. X                      curr_window->is_chars = $5;
  201. X                    }
  202. X        ;
  203. X
  204. Xposition    :    AT INTEGER INTEGER
  205. X                    { curr_window->win_x = $2;
  206. X                      curr_window->win_y = $3;
  207. X                    }
  208. X        ;
  209. X
  210. Xsize_unit    :    CHARACTERS
  211. X                    { $$ = TRUE; }
  212. X        |    PIXELS
  213. X                    { $$ = FALSE; }
  214. X        ;
  215. X
  216. Xicon        :    ICON STRING
  217. X                    { $$ = $2; }
  218. X        ;
  219. X
  220. Xlabel        :    LABEL STRING
  221. X                    { $$ = $2; }
  222. X        ;
  223. X
  224. Xfont        :    FONT STRING
  225. X                    { $$ = $2; }
  226. X        ;
  227. X
  228. Xopen        :    OPEN action
  229. X                    { $$ = $2; }
  230. X        ;
  231. X
  232. Xclose        :    CLOSE action
  233. X                    { $$ = $2; }
  234. X        ;
  235. X
  236. Xinitialize    :    INITIALIZE action
  237. X                    { $$ = $2; }
  238. X        ;
  239. X
  240. Xtimer        :    TIMER action
  241. X                    { $$ = $2; }
  242. X        ;
  243. X
  244. Xgadgets        :    empty
  245. X                    { $$ = (g_ptr) 0; }
  246. X        |    GADGETS gadget_attr gadget_list END_GADGETS
  247. X                    { if (curr_window->gadget_pos == G_NOPOS)
  248. X                         curr_window->gadget_pos = G_TOP;
  249. X                      $$ = $3;
  250. X                    }
  251. X        ;
  252. X
  253. Xgadget_attr    :    empty
  254. X        |    gadget_attr TOP
  255. X                    { if (curr_window->gadget_pos == G_NOPOS)
  256. X                         curr_window->gadget_pos = G_TOP;
  257. X                      else
  258. X                         yyerror("Conflicting gadget position specified");
  259. X                    }
  260. X        |    gadget_attr BOTTOM
  261. X                    { if (curr_window->gadget_pos == G_NOPOS)
  262. X                         curr_window->gadget_pos = G_BOTTOM;
  263. X                      else
  264. X                         yyerror("Conflicting gadget position specified");
  265. X                    }
  266. X        |    gadget_attr LEFT
  267. X                    { if (curr_window->gadget_pos == G_NOPOS)
  268. X                         curr_window->gadget_pos = G_LEFT;
  269. X                      else
  270. X                         yyerror("Conflicting gadget position specified");
  271. X                    }
  272. X        |    gadget_attr RIGHT
  273. X                    { if (curr_window->gadget_pos == G_NOPOS)
  274. X                         curr_window->gadget_pos = G_RIGHT;
  275. X                      else
  276. X                         yyerror("Conflicting gadget position specified");
  277. X                    }
  278. X        |    gadget_attr PROPORTIONAL
  279. X                    { curr_window->proportional = TRUE; }
  280. X        |    gadget_attr RAGGED
  281. X                    { curr_window->justified = FALSE; }
  282. X        |    gadget_attr font
  283. X                    { if (curr_window->g_font == tt_default_font)
  284. X                         curr_window->g_font = tt_open_font($2);
  285. X                      else
  286. X                         yyerror("Conflicting gadget font specified");
  287. X                    }
  288. X        |    gadget_attr align
  289. X                    { if (curr_window->g_align == NO_ALIGN)
  290. X                         curr_window->g_align = $2;
  291. X                      else
  292. X                         yyerror("Conflicting gadget alignment specified");
  293. X                    }
  294. X        ;
  295. X
  296. Xalign        :    ALIGN LEFT
  297. X                    { $$ = ALIGN_TOP; }
  298. X        |    ALIGN CENTER
  299. X                    { $$ = ALIGN_MIDDLE; }
  300. X        |    ALIGN RIGHT
  301. X                    { $$ = ALIGN_BOTTOM; }
  302. X        |    ALIGN TOP
  303. X                    { $$ = ALIGN_TOP; }
  304. X        |    ALIGN MIDDLE
  305. X                    { $$ = ALIGN_MIDDLE; }
  306. X        |    ALIGN BOTTOM
  307. X                    { $$ = ALIGN_BOTTOM; }
  308. X        ;
  309. X
  310. Xgadget_list    :    empty
  311. X                    { $$ = NULL; }
  312. X        |    gadget_list gadget
  313. X                    { g_ptr    g;
  314. X                      
  315. X                      if ($1 == NULL)
  316. X                         $$ = $2;
  317. X                      else {
  318. X                         for (g = $1; g->next; g = g->next)
  319. X                            ;
  320. X                         g->next = $2;
  321. X                         $$ = $1;
  322. X                         }
  323. X                    }
  324. X        ;
  325. X
  326. Xgadget        :    button_gadget
  327. X        |    choice_gadget
  328. X        |    label_gadget
  329. X        |    menu_gadget
  330. X        |    slider_gadget
  331. X        |    text_gadget
  332. X        ;
  333. X
  334. Xbutton_gadget    :    BUTTON optional_name
  335. X                    { int    i;
  336. X                      s_ptr    s;
  337. X
  338. X                      curr_gadget = (g_ptr) safe_malloc(sizeof(g_data));
  339. X                      curr_gadget->kind = GADGET_BUTTON;
  340. X                      curr_gadget->name = NULL;
  341. X                      curr_gadget->image = NULL;
  342. X                      curr_gadget->x = -1;
  343. X                      curr_gadget->next = NULL;
  344. X                      for (i = 0; i < MAX_SHIFT_SETS; i++) {
  345. X                         curr_gadget->u.but.label[i] = NULL;
  346. X                         curr_gadget->u.but.action[i] = NULL;
  347. X                         }
  348. X                      if ($2 != NULL) {
  349. X                         s = tt_find_symbol($2);
  350. X                         if (s->kind != SYMBOL_SYMBOL)
  351. X                            yyerror("Duplicate name: %s", s->name);
  352. X                         s->kind = SYMBOL_GADGET;
  353. X                         s->gadget = curr_gadget;
  354. X                         }
  355. X                    }
  356. X            gadget_position value_list value_item END_BUTTON
  357. X                    { if (curr_gadget->u.but.label[0] == NULL)
  358. X                         yyerror("Every button must have a \"normal\" action");
  359. X                      $$ = curr_gadget;
  360. X                    }
  361. X        ;
  362. X
  363. Xvalue_list    :    empty
  364. X        |    value_list value_item
  365. X        ;
  366. X
  367. Xvalue_item    :    shifts icon_label action
  368. X                    { if (curr_gadget->u.but.label[$1] != NULL)
  369. X                         yyerror("Duplicate button action");
  370. X                      curr_gadget->u.but.label[$1] = $2;
  371. X                      curr_gadget->u.but.action[$1] = $3;
  372. X                    }
  373. X        ;
  374. X
  375. Xshifts        :    empty
  376. X                    { $$ = S_NORMAL; }
  377. X        |    shifts NORMAL
  378. X                    { $$ = $1 | S_NORMAL; }
  379. X        |    shifts SHIFT
  380. X                    { $$ = $1 | S_SHIFT; }
  381. X        |    shifts CONTROL
  382. X                    { $$ = $1 | S_CONTROL; }
  383. X        |    shifts META
  384. X                    { $$ = $1 | S_META; }
  385. X        ;
  386. X
  387. Xchoice_gadget    :    CHOICE optional_name
  388. X                    { s_ptr    s;
  389. X
  390. X                      curr_gadget = (g_ptr) safe_malloc(sizeof(g_data));
  391. X                      curr_gadget->kind = GADGET_CHOICE;
  392. X                      curr_gadget->name = $2;
  393. X                      curr_gadget->image = NULL;
  394. X                      curr_gadget->x = -1;
  395. X                      curr_gadget->next = NULL;
  396. X                      curr_gadget->u.cho.label = NULL;
  397. X                      curr_gadget->u.cho.mode = CHOICE_CURRENT;
  398. X                      curr_gadget->u.cho.mark = tt_default_mark;
  399. X                      curr_gadget->u.cho.nomark = tt_default_nomark;
  400. X                      curr_gadget->u.cho.value = NULL;
  401. X                      if ($2 != NULL) {
  402. X                         s = tt_find_symbol($2);
  403. X                         if (s->kind != SYMBOL_SYMBOL)
  404. X                            yyerror("Duplicate name: %s", s->name);
  405. X                         s->kind = SYMBOL_GADGET;
  406. X                         s->gadget = curr_gadget;
  407. X                         }
  408. X                    }
  409. X            choice_attr choice_list END_CHOICE
  410. X                    { curr_gadget->u.cho.value = $5;
  411. X                      if (curr_gadget->u.cho.mode == CHOICE_CYCLE)
  412. X                         if (curr_gadget->u.cho.mark == tt_default_mark)
  413. X                            curr_gadget->u.cho.mark = curr_gadget->u.cho.nomark = tt_default_cycle;
  414. X                         else
  415. X                            curr_gadget->u.cho.nomark = curr_gadget->u.cho.mark;
  416. X                      $$ = curr_gadget;
  417. X                    }
  418. X        ;
  419. X
  420. Xchoice_attr    :    empty
  421. X        |    choice_attr DISPLAY CURRENT
  422. X                    { curr_gadget->u.cho.mode = CHOICE_CURRENT; }
  423. X        |    choice_attr DISPLAY CYCLE
  424. X                    { curr_gadget->u.cho.mode = CHOICE_CYCLE; }
  425. X        |    choice_attr DISPLAY HORIZONTAL
  426. X                    { curr_gadget->u.cho.mode = CHOICE_HORIZONTAL; }
  427. X        |    choice_attr DISPLAY VERTICAL
  428. X                    { curr_gadget->u.cho.mode = CHOICE_VERTICAL; }
  429. X        |    choice_attr MARK icon_label
  430. X                    { curr_gadget->u.cho.mark = $3; }
  431. X        |    choice_attr NOMARK icon_label
  432. X                    { curr_gadget->u.cho.nomark = $3; }
  433. X        |    choice_attr LABEL icon_label
  434. X                    { curr_gadget->u.cho.label = $3; }
  435. X        |    choice_attr AT INTEGER INTEGER
  436. X                    { curr_gadget->x = $3;
  437. X                      curr_gadget->y = $4;
  438. X                    }
  439. X        ;
  440. X
  441. Xchoice_list    :    empty
  442. X                    { $$ = NULL; }
  443. X        |    choice_list icon_label action
  444. X                    { cv_ptr curr, head;
  445. X                    
  446. X                      curr = (cv_ptr) safe_malloc(sizeof(cv_data));
  447. X                      curr->label = $2;
  448. X                      curr->action = $3;
  449. X                      curr->next = NULL;
  450. X                      if ($1 == NULL)
  451. X                         $$ = curr;
  452. X                      else {
  453. X                         for (head = $1; head->next; head = head->next)
  454. X                            ;
  455. X                         head->next = curr;
  456. X                         $$ = $1;
  457. X                         }
  458. X                    }
  459. X        ;
  460. X
  461. Xlabel_gadget    :    LABEL optional_name
  462. X                    { s_ptr    s;
  463. X
  464. X                      curr_gadget = (g_ptr) safe_malloc(sizeof(g_data));
  465. X                      curr_gadget->kind = GADGET_LABEL;
  466. X                      curr_gadget->name = NULL;
  467. X                      curr_gadget->image = NULL;
  468. X                      curr_gadget->x = -1;
  469. X                      curr_gadget->next = NULL;
  470. X                      if ($2 != NULL) {
  471. X                         s = tt_find_symbol($2);
  472. X                         if (s->kind != SYMBOL_SYMBOL)
  473. X                            yyerror("Duplicate name: %s", s->name);
  474. X                         s->kind = SYMBOL_GADGET;
  475. X                         s->gadget = curr_gadget;
  476. X                         }
  477. X                    }
  478. X            gadget_position icon_label END_LABEL
  479. X                    { curr_gadget->u.lab.label = $5;
  480. X                      $$ = curr_gadget;
  481. X                    }
  482. X        ;
  483. X
  484. Xmenu_gadget    :    MENU optional_name
  485. X                    { s_ptr    s;
  486. X
  487. X                      curr_gadget = (g_ptr) safe_malloc(sizeof(g_data));
  488. X                      curr_gadget->kind = GADGET_MENU;
  489. X                      curr_gadget->name = NULL;
  490. X                      curr_gadget->image = NULL;
  491. X                      curr_gadget->x = -1;
  492. X                      curr_gadget->next = NULL;
  493. X                      if ($2 != NULL) {
  494. X                         s = tt_find_symbol($2);
  495. X                         if (s->kind != SYMBOL_SYMBOL)
  496. X                            yyerror("Duplicate name: %s", s->name);
  497. X                         s->kind = SYMBOL_GADGET;
  498. X                         s->gadget = curr_gadget;
  499. X                         }
  500. X                    }
  501. X            gadget_position icon_label menu_value END_MENU
  502. X                    { curr_gadget->u.men.label = $5;
  503. X                      curr_gadget->u.men.menu = $6;
  504. X                      $$ = curr_gadget;
  505. X                    }
  506. X        ;
  507. X
  508. Xmenu        :    MENU menu_value END_MENU
  509. X                    { $$ = $2; }
  510. X        |    TTYMENU
  511. X                    { $$ = menu_create(MENU_GEN_PROC, ttymenu_proc, 0); }
  512. X        ;
  513. X
  514. Xmenu_value    :    menu_entry
  515. X                    { $$ = menu_create(MENU_APPEND_ITEM, $1, 0); }
  516. X        |    menu_value menu_entry
  517. X                    { 
  518. X                      menu_set($1, MENU_APPEND_ITEM, $2, 0);
  519. X                      $$ = $1;
  520. X                    }
  521. X        ;
  522. X
  523. Xmenu_entry    :    icon_label action
  524. X                    {
  525. X                      if ($1->is_icon)
  526. X                         $$ = menu_create_item(MENU_IMAGE_ITEM, $1->image, $2, 0);
  527. X                      else
  528. X                         $$ = menu_create_item(MENU_STRING_ITEM, $1->label, $2, MENU_FONT, $1->font, 0);
  529. X                    }
  530. X        |    icon_label menu
  531. X                    {
  532. X                      if ($1->is_icon)
  533. X                         $$ = menu_create_item(MENU_PULLRIGHT_IMAGE, $1->image, $2, 0);
  534. X                      else
  535. X                         $$ = menu_create_item(MENU_PULLRIGHT_ITEM, $1->label, $2, MENU_FONT, $1->font, 0);
  536. X                    }
  537. X        ;
  538. X
  539. Xslider_gadget    :    SLIDER optional_name
  540. X                    { s_ptr    s;
  541. X                    
  542. X                      curr_gadget = (g_ptr) safe_malloc(sizeof(g_data));
  543. X                      curr_gadget->kind = GADGET_SLIDER;
  544. X                      curr_gadget->name = $2;
  545. X                      curr_gadget->image = NULL;
  546. X                      curr_gadget->x = -1;
  547. X                      curr_gadget->next = NULL;
  548. X                      curr_gadget->u.sli.label = NULL;
  549. X                      curr_gadget->u.sli.minimum = 0;
  550. X                      curr_gadget->u.sli.maximum = 100;
  551. X                      curr_gadget->u.sli.initial = 0;
  552. X                      curr_gadget->u.sli.value = TRUE;
  553. X                      curr_gadget->u.sli.range = TRUE;
  554. X                      curr_gadget->u.sli.width = 100;
  555. X                      curr_gadget->u.sli.action = NULL;
  556. X                      curr_gadget->u.sli.font = curr_window->g_font;
  557. X                      if ($2 != NULL) {
  558. X                         s = tt_find_symbol($2);
  559. X                         if (s->kind != SYMBOL_SYMBOL)
  560. X                            yyerror("Duplicate name: %s", s->name);
  561. X                         s->kind = SYMBOL_GADGET;
  562. X                         s->gadget = curr_gadget;
  563. X                         }
  564. X                    }
  565. X            slider_attr END_SLIDER
  566. X                    {
  567. X                      if (curr_gadget->u.sli.minimum > curr_gadget->u.sli.maximum)
  568. X                         yyerror("Slider maximum must exceed slider minimum");
  569. X                      if (curr_gadget->u.sli.initial < curr_gadget->u.sli.minimum ||
  570. X                          curr_gadget->u.sli.initial > curr_gadget->u.sli.maximum)
  571. X                         yyerror("Slider initial value must in the range [minimum, maximum]");
  572. X                      $$ = curr_gadget;
  573. X                    }
  574. X        ;
  575. X
  576. Xslider_attr    :    empty
  577. X        |    slider_attr ACTION action
  578. X                    { curr_gadget->u.sli.action = $3; }
  579. X        |    slider_attr FONT STRING
  580. X                    { curr_gadget->u.sli.font = tt_open_font($3); }
  581. X        |    slider_attr INITIAL INTEGER
  582. X                    { curr_gadget->u.sli.initial = $3; }
  583. X        |    slider_attr LABEL icon_label
  584. X                    { curr_gadget->u.sli.label = $3; }
  585. X        |    slider_attr MAXIMUM INTEGER
  586. X                    { curr_gadget->u.sli.maximum = $3; }
  587. X        |    slider_attr MINIMUM INTEGER
  588. X                    { curr_gadget->u.sli.minimum = $3; }
  589. X        |    slider_attr RANGE OFF
  590. X                    { curr_gadget->u.sli.range = FALSE; }
  591. X        |    slider_attr RANGE ON
  592. X                    { curr_gadget->u.sli.range = TRUE; }
  593. X        |    slider_attr VALUE OFF
  594. X                    { curr_gadget->u.sli.value = FALSE; }
  595. X        |    slider_attr VALUE ON
  596. X                    { curr_gadget->u.sli.value = TRUE; }
  597. X        |    slider_attr WIDTH INTEGER
  598. X                    { curr_gadget->u.sli.width = $3; }
  599. X        |    slider_attr AT INTEGER INTEGER
  600. X                    { curr_gadget->x = $3;
  601. X                      curr_gadget->y = $4;
  602. X                    }
  603. X        ;
  604. X
  605. Xtext_gadget    :    TEXT optional_name
  606. X                    { s_ptr    s;
  607. X
  608. X                      curr_gadget = (g_ptr) safe_malloc(sizeof(g_data));
  609. X                      curr_gadget->kind = GADGET_TEXT;
  610. X                      curr_gadget->name = $2;
  611. X                      curr_gadget->image = NULL;
  612. X                      curr_gadget->x = -1;
  613. X                      curr_gadget->next = NULL;
  614. X                      curr_gadget->u.tex.label = NULL;
  615. X                      curr_gadget->u.tex.trigger = "\n\r";
  616. X                      curr_gadget->u.tex.completion = "";
  617. X                      curr_gadget->u.tex.ignore = tt_expand_ranges("\001-\037");
  618. X                      curr_gadget->u.tex.display_len = 80;
  619. X                      curr_gadget->u.tex.retain_len = 256;
  620. X                      curr_gadget->u.tex.action = NULL;
  621. X                      curr_gadget->u.tex.font = curr_window->g_font;
  622. X                      curr_window->text_items_exist = TRUE;
  623. X                      if ($2 != NULL) {
  624. X                         s = tt_find_symbol($2);
  625. X                         if (s->kind != SYMBOL_SYMBOL)
  626. X                            yyerror("Duplicate name: %s", s->name);
  627. X                         s->kind = SYMBOL_GADGET;
  628. X                         s->gadget = curr_gadget;
  629. X                         }
  630. X                    }
  631. X            text_attr END_TEXT
  632. X                    { $$ = curr_gadget; }
  633. X        ;
  634. X
  635. Xtext_attr    :    empty
  636. X        |    text_attr ACTION action
  637. X                    { curr_gadget->u.tex.action = $3; }
  638. X        |    text_attr AT INTEGER INTEGER
  639. X                    { curr_gadget->x = $3;
  640. X                      curr_gadget->y = $4;
  641. X                    }
  642. X        |    text_attr COMPLETION STRING
  643. X                    { curr_gadget->u.tex.completion = tt_expand_ranges($3); }
  644. X        |    text_attr DISPLAY INTEGER
  645. X                    { curr_gadget->u.tex.display_len = $3; }
  646. X        |    text_attr FONT STRING
  647. X                    { curr_gadget->u.tex.font = tt_open_font($3); }
  648. X        |    text_attr IGNORE STRING
  649. X                    { curr_gadget->u.tex.ignore = tt_expand_ranges($3); }
  650. X        |    text_attr LABEL icon_label
  651. X                    { curr_gadget->u.tex.label = $3; }
  652. X        |    text_attr RETAIN INTEGER
  653. X                    { curr_gadget->u.tex.retain_len = $3; }
  654. X        |    text_attr TRIGGER STRING
  655. X                    { curr_gadget->u.tex.trigger = tt_expand_ranges($3); }
  656. X        ;
  657. X
  658. Xicon_label    :    STRING
  659. X                    { $$ = tt_make_label(FALSE, $1, curr_window->g_font, NULL); }
  660. X        |    STRING COLON STRING
  661. X                    { $$ = tt_make_label(FALSE, $1, tt_open_font($3), NULL); }
  662. X        |    ICON_STRING
  663. X                    { $$ = tt_make_label(TRUE, NULL, NULL, tt_load_icon($1)); }
  664. X        ;
  665. X
  666. Xoptional_name    :    empty
  667. X                    { $$ = NULL; }
  668. X        |    ID
  669. X                    { $$ = $1; }
  670. X        ;
  671. X
  672. Xgadget_position    :    empty
  673. X        |    AT INTEGER INTEGER
  674. X                    { curr_gadget->x = $2;
  675. X                      curr_gadget->y = $3;
  676. X                    }
  677. X        ;
  678. X
  679. Xaction        :    SEMICOLON
  680. X                    { $$ = NULL; }
  681. X        |    BEEP SEMICOLON
  682. X                    { $$ = tt_make_action(BEEP_OP); }
  683. X        |    BREAK SEMICOLON
  684. X                    { $$ = tt_make_action(BREAK_OP); }
  685. X        |    CLOSE %prec ACTION
  686. X                    { $$ = tt_make_action(CLOSE_OP); }
  687. X        |    CLOSE SEMICOLON
  688. X                    { $$ = tt_make_action(CLOSE_OP); }
  689. X        |    CONTINUE SEMICOLON
  690. X                    { $$ = tt_make_action(CONTINUE_OP); }
  691. X        |    DISPLAY ID SEMICOLON
  692. X                    { $$ = tt_make_action(DISPLAY_OP, tt_make_expr(E_SYMBOL, tt_find_symbol($2))); }
  693. X        |    EXIT %prec ACTION
  694. X                    { $$ = tt_make_action(EXIT_OP); }
  695. X        |    EXIT SEMICOLON
  696. X                    { $$ = tt_make_action(EXIT_OP); }
  697. X        |    expr %prec EXPR
  698. X                    { $$ = tt_make_action(($1->op == E_STRING)? SEND_OP : EXPR_OP, $1); }
  699. X        |    expr SEMICOLON %prec EXPR
  700. X                    { $$ = tt_make_action(($1->op == E_STRING)? SEND_OP : EXPR_OP, $1); }
  701. X        |    FOR LPAREN optional_expr SEMICOLON optional_expr SEMICOLON optional_expr RPAREN action
  702. X                    { $$ = tt_make_action(FOR_OP, $3, $5, $7, $9); }
  703. X        |    IF LPAREN expr RPAREN action %prec ACTION
  704. X                    { $$ = tt_make_action(IF_OP, $3, $5, NULL); }
  705. X        |    IF LPAREN expr RPAREN action ELSE action %prec ELSE
  706. X                    { $$ = tt_make_action(IF_OP, $3, $5, $7); }
  707. X        |    LBRACE action_list RBRACE
  708. X                    { $$ = $2; }
  709. X        |    NOTHING SEMICOLON
  710. X                    { $$ = NULL; }
  711. X        |    OPEN SEMICOLON
  712. X                    { $$ = tt_make_action(OPEN_OP); }
  713. X        |    POPUP ID SEMICOLON
  714. X                    { $$ = tt_make_action(POPUP_OP, tt_make_expr(E_SYMBOL, tt_find_symbol($2))); }
  715. X        |    REMOVE ID SEMICOLON
  716. X                    { $$ = tt_make_action(REMOVE_OP, tt_make_expr(E_SYMBOL, tt_find_symbol($2))); }
  717. X        |    SEND expr SEMICOLON %prec EXPR
  718. X                    { $$ = tt_make_action(SEND_OP, $2); }
  719. X        |    WHILE LPAREN expr RPAREN action
  720. X                    { $$ = tt_make_action(WHILE_OP, $3, $5); }
  721. X        ;
  722. X
  723. Xaction_list    :    empty
  724. X                    { $$ = NULL; }
  725. X        |    action action_list
  726. X                    { a_ptr    a;
  727. X
  728. X                      if ($1 == NULL)
  729. X                         $$ = $2;
  730. X                      else {
  731. X                         for (a = $1; a->next != NULL; a = a->next)
  732. X                            ;
  733. X                         a->next = $2;
  734. X                         $$ = $1;
  735. X                         }
  736. X                    }
  737. X        ;
  738. X
  739. Xoptional_expr    :    empty
  740. X                    { $$ = NULL; }
  741. X        |    expr
  742. X        ;
  743. X
  744. Xexpr        :    factor
  745. X        |    array_ref ASSIGNMENT expr
  746. X                    { if ($1->op == E_FUNC_ID)
  747. X                         yyerror("cannot assign to an intrinsic function");
  748. X                      $$ = tt_make_expr(E_ASSIGNMENT, $1, $3);
  749. X                    }
  750. X        |    array_ref ASSIGN_AND expr
  751. X                    { if ($1->op == E_FUNC_ID)
  752. X                         yyerror("cannot assign to an intrinsic function");
  753. X                      $$ = tt_make_expr(E_ASSIGN_AND, $1, $3);
  754. X                    }
  755. X        |    array_ref ASSIGN_DIVIDE expr
  756. X                    { if ($1->op == E_FUNC_ID)
  757. X                         yyerror("cannot assign to an intrinsic function");
  758. X                      $$ = tt_make_expr(E_ASSIGN_DIVIDE, $1, $3);
  759. X                    }
  760. X        |    array_ref ASSIGN_MINUS expr
  761. X                    { if ($1->op == E_FUNC_ID)
  762. X                         yyerror("cannot assign to an intrinsic function");
  763. X                      $$ = tt_make_expr(E_ASSIGN_MINUS, $1, $3);
  764. X                    }
  765. X        |    array_ref ASSIGN_MODULO expr
  766. X                    { if ($1->op == E_FUNC_ID)
  767. X                         yyerror("cannot assign to an intrinsic function");
  768. X                      $$ = tt_make_expr(E_ASSIGN_MODULO, $1, $3);
  769. X                    }
  770. X        |    array_ref ASSIGN_OR expr
  771. X                    { if ($1->op == E_FUNC_ID)
  772. X                         yyerror("cannot assign to an intrinsic function");
  773. X                      $$ = tt_make_expr(E_ASSIGN_OR, $1, $3);
  774. X                    }
  775. X        |    array_ref ASSIGN_PLUS expr
  776. X                    { if ($1->op == E_FUNC_ID)
  777. X                         yyerror("cannot assign to an intrinsic function");
  778. X                      $$ = tt_make_expr(E_ASSIGN_PLUS, $1, $3);
  779. X                    }
  780. X        |    array_ref ASSIGN_TIMES expr
  781. X                    { if ($1->op == E_FUNC_ID)
  782. X                         yyerror("cannot assign to an intrinsic function");
  783. X                      $$ = tt_make_expr(E_ASSIGN_TIMES, $1, $3);
  784. X                    }
  785. X        |    array_ref ASSIGN_XOR expr
  786. X                    { if ($1->op == E_FUNC_ID)
  787. X                         yyerror("cannot assign to an intrinsic function");
  788. X                      $$ = tt_make_expr(E_ASSIGN_XOR, $1, $3);
  789. X                    }
  790. X        |    LPAREN expr RPAREN
  791. X                    { $$ = tt_make_expr(E_PAREN, $2); }
  792. X        |    expr PLUS expr
  793. X                    { $$ = tt_make_expr(E_PLUS, $1, $3); }
  794. X        |    expr MINUS expr
  795. X                    { $$ = tt_make_expr(E_MINUS, $1, $3); }
  796. X        |    expr TIMES expr
  797. X                    { $$ = tt_make_expr(E_TIMES, $1, $3); }
  798. X        |    expr DIVIDE expr
  799. X                    { $$ = tt_make_expr(E_DIVIDE, $1, $3); }
  800. X        |    expr MODULO expr
  801. X                    { $$ = tt_make_expr(E_MODULO, $1, $3); }
  802. X        |    expr AND expr
  803. X                    { $$ = tt_make_expr(E_AND, $1, $3); }
  804. X        |    expr OR expr
  805. X                    { $$ = tt_make_expr(E_OR, $1, $3); }
  806. X        |    expr XOR expr
  807. X                    { $$ = tt_make_expr(E_XOR, $1, $3); }
  808. X        |    expr LOGICAL_AND expr
  809. X                    { $$ = tt_make_expr(E_LOGICAL_AND, $1, $3); }
  810. X        |    expr LOGICAL_OR expr
  811. X                    { $$ = tt_make_expr(E_LOGICAL_OR, $1, $3); }
  812. X        |    expr LEFT_SHIFT expr
  813. X                    { $$ = tt_make_expr(E_LEFT_SHIFT, $1, $3); }
  814. X        |    expr RIGHT_SHIFT expr
  815. X                    { $$ = tt_make_expr(E_RIGHT_SHIFT, $1, $3); }
  816. X        |    expr LESS expr
  817. X                    { $$ = tt_make_expr(E_LESS, $1, $3); }
  818. X        |    expr LESS_EQUAL expr
  819. X                    { $$ = tt_make_expr(E_LESS_EQUAL, $1, $3); }
  820. X        |    expr EQUAL expr
  821. X                    { $$ = tt_make_expr(E_EQUAL, $1, $3); }
  822. X        |    expr GREATER_EQUAL expr
  823. X                    { $$ = tt_make_expr(E_GREATER_EQUAL, $1, $3); }
  824. X        |    expr GREATER expr
  825. X                    { $$ = tt_make_expr(E_GREATER, $1, $3); }
  826. X        |    expr NOT_EQUAL expr
  827. X                    { $$ = tt_make_expr(E_NOT_EQUAL, $1, $3); }
  828. X        |    expr COMMA expr
  829. X                    { $$ = tt_make_expr(E_COMMA, $1, $3); }
  830. X        |    MINUS expr %prec UMINUS
  831. X                    { $$ = tt_make_expr(E_UMINUS, $2); }
  832. X        |    COMPLEMENT expr
  833. X                    { $$ = tt_make_expr(E_COMPLEMENT, $2); }
  834. X        |    LOGICAL_NOT expr
  835. X                    { $$ = tt_make_expr(E_LOGICAL_NOT, $2); }
  836. X        |    DECREMENT array_ref
  837. X                    { if ($2->op == E_FUNC_ID)
  838. X                         yyerror("cannot decrement an intrinsic function");
  839. X                      $$ = tt_make_expr(E_PREDECREMENT, $2);
  840. X                    }
  841. X        |    INCREMENT array_ref
  842. X                    { if ($2->op == E_FUNC_ID)
  843. X                         yyerror("cannot increment an intrinsic function");
  844. X                      $$ = tt_make_expr(E_PREINCREMENT, $2);
  845. X                    }
  846. X        |    array_ref DECREMENT
  847. X                    { if ($1->op == E_FUNC_ID)
  848. X                         yyerror("cannot decrement an intrinsic function");
  849. X                      $$ = tt_make_expr(E_POSTDECREMENT, $1);
  850. X                    }
  851. X        |    array_ref INCREMENT
  852. X                    { if ($1->op == E_FUNC_ID)
  853. X                         yyerror("cannot increment an intrinsic function");
  854. X                      $$ = tt_make_expr(E_POSTINCREMENT, $1);
  855. X                    }
  856. X        |    expr QUESTION expr COLON expr
  857. X                    { $$ = tt_make_expr(E_QUESTION, $1, $3, $5); }
  858. X        ;
  859. X
  860. Xfactor        :    array_ref %prec ARRAY_REF
  861. X        |    STRING
  862. X                    { $$ = tt_make_expr(E_STRING, $1); }
  863. X        |    INTEGER
  864. X                    { double temp;
  865. X
  866. X                      temp = (double) $1;
  867. X                      $$ = tt_make_expr(E_NUMBER, &temp);
  868. X                    }
  869. X        |    REAL
  870. X                    { $$ = tt_make_expr(E_NUMBER, &($1)); }
  871. X        ;
  872. X
  873. Xarray_ref    :    ID %prec ARRAY_REF
  874. X                    { $$ = tt_make_expr(E_SYMBOL, tt_find_symbol($1)); }
  875. X        |    ID LPAREN optional_expr RPAREN %prec LPAREN
  876. X                    { f_ptr    func;
  877. X
  878. X                      if ((func = tt_is_function($1)) == NULL)
  879. X                         yyerror("'%s' is not a valid function name", $1);
  880. X                      $$ = tt_make_expr(E_FUNC_ID, func, $3);
  881. X                    }
  882. X        |    array_ref LBRACK expr RBRACK
  883. X                    { $$ = tt_make_expr(E_ARRAY_REF, $1, $3); }
  884. X        ;
  885. X
  886. Xdialogs        :    empty
  887. X        |    dialogs dialog_box
  888. X        ;
  889. X
  890. Xdialog_box    :    DIALOG ID
  891. X                    { s_ptr    s;
  892. X                      
  893. X                      curr_window = tt_make_base_window();
  894. X                      curr_window->next = tt_base_window->next;
  895. X                      tt_base_window->next = curr_window;
  896. X                      s = tt_find_symbol($2);
  897. X                      if (s->kind == SYMBOL_SYMBOL)
  898. X                         s->kind = SYMBOL_DIALOG;
  899. X                      else if (s->kind == SYMBOL_GADGET)
  900. X                         yyerror("%s: name is already in use as a gadget", $2);
  901. X                      else if (s->dialog != NULL)
  902. X                         yyerror("%s: name is already in use as a dialog box", $2);
  903. X                      s->dialog = curr_window;
  904. X                      curr_window->is_open = FALSE;
  905. X                    }
  906. X            dialog_attr gadgets END_DIALOG
  907. X                    { curr_window->gadgets = $5; }
  908. X        ;
  909. X
  910. Xdialog_attr    :    empty
  911. X        |    dialog_attr size
  912. X        |    dialog_attr position
  913. X        |    dialog_attr label
  914. X                    { if (curr_window->label == NULL)
  915. X                         curr_window->label = $2;
  916. X                      else
  917. X                         yyerror("Conflicting window label specifications");
  918. X                    }
  919. X        |    dialog_attr open
  920. X                    { if (curr_window->open_action == NULL)
  921. X                         curr_window->open_action = $2;
  922. X                      else
  923. X                         yyerror("Conflicting window opening strings");
  924. X                    }
  925. X        |    dialog_attr close
  926. X                    { if (curr_window->close_action == NULL)
  927. X                         curr_window->close_action = $2;
  928. X                      else
  929. X                         yyerror("Conflicting window closing strings");
  930. X                    }
  931. X        ;
  932. X
  933. X
  934. Xkeys        :    empty
  935. X        |    KEYS key_attr key_list END_KEYS
  936. X        ;
  937. X
  938. Xkey_attr    :    empty
  939. X        |    key_attr DISABLE NORMAL_KEYS
  940. X                    { tt_normal_off = TRUE; }
  941. X        |    key_attr DISABLE FUNCTION_KEYS
  942. X                    { tt_function_off = TRUE; }
  943. X        ;
  944. X
  945. Xkey_list    :    empty
  946. X        |    key_list key_entry
  947. X        ;
  948. X
  949. Xkey_entry    :    KEY key_name
  950. X                    { if ($2 >= L2 && $2 <= L10) {
  951. X                         curr_key_set = LEFT_KEY_SET;
  952. X                         curr_key = $2 - L2 + 1;
  953. X                         }
  954. X                      else if ($2 >= F1 && $2 <= F9) {
  955. X                         curr_key_set = TOP_KEY_SET;
  956. X                         curr_key = $2 - F1;
  957. X                         }
  958. X                      else {
  959. X                         curr_key_set = RIGHT_KEY_SET;
  960. X                         curr_key = $2 - R1;
  961. X                         }
  962. X                    }
  963. X            key_value_list END_KEY
  964. X        ;
  965. X
  966. Xkey_name    :    L2 | L3 | L4 | L5 | L6 | L7 | L8 | L9 | L10
  967. X        |    F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 
  968. X        |    R1 | R2 | R3 | R4 | R5 | R6 | R7 | R8 | R9 | R10 | R11 | R12 | R13 | R14 | R15
  969. X        ;
  970. X
  971. Xkey_value_list    :    key_value_entry
  972. X        |    key_value_list key_value_entry
  973. X        ;
  974. X
  975. Xkey_value_entry    :    shifts action
  976. X                    { tt_func_keys[curr_key_set][curr_key][$1] = $2; }
  977. X        ;
  978. X
  979. Xmouse        :    empty
  980. X        |    MOUSE mouse_attr mouse_list END_MOUSE
  981. X        ;
  982. X
  983. Xmouse_attr    :    empty
  984. X        |    BASE INTEGER size_unit
  985. X                    { tt_mouse_base = $2;
  986. X                      tt_mouse_chars = $3;
  987. X                    }
  988. X        ;
  989. X
  990. Xmouse_list    :    empty
  991. X        |    mouse_list mouse_entry
  992. X        ;
  993. X
  994. Xmouse_entry    :    BUTTON button_name
  995. X                    { curr_key = $2; }
  996. X            mouse_values END_BUTTON
  997. X        ;
  998. X
  999. Xbutton_name    :    LEFT
  1000. X                    { $$ = MOUSE_LEFT; }
  1001. X        |    MIDDLE
  1002. X                    { $$ = MOUSE_CENTER; }
  1003. X        |    RIGHT
  1004. X                    { $$ = MOUSE_RIGHT; }
  1005. X        ;
  1006. X
  1007. Xmouse_values    :    empty
  1008. X        |    mouse_values mouse_value
  1009. X        ;
  1010. X
  1011. Xmouse_value    :    shifts action
  1012. X                    { tt_mouse[curr_key][$1].defined = MOUSE_STRING;
  1013. X                      tt_mouse[curr_key][$1].action = $2;
  1014. X                    }
  1015. X        |    shifts menu
  1016. X                    { tt_mouse[curr_key][$1].defined = MOUSE_MENU;
  1017. X                      tt_mouse[curr_key][$1].menu = $2;
  1018. X                    }
  1019. X        ;
  1020. X
  1021. Xempty        : ;
  1022. X
  1023. X%%
  1024. X
  1025. XPRIVATE    yyerror(s1, s2, s3, s4, s5, s6, s7)
  1026. X
  1027. Xchar    *s1, *s2, *s3, *s4, *s5, *s6, *s7;
  1028. X
  1029. X{
  1030. X    fprintf(stderr, "%s: line %d: ", tt_curr_file, line_count - ((ungetc == '\n')? 1 : 0));
  1031. X    fprintf(stderr, s1, s2, s3, s4, s5, s6, s7);
  1032. X    if (strcmp(s1, "syntax error") == 0)
  1033. X       print_last_token();
  1034. X    fprintf(stderr, "\n");
  1035. X    yyclearin;
  1036. X    tt_errors_occured++;
  1037. X}
  1038. X
  1039. X#include "lex.c"
  1040. X
  1041. END_OF_FILE
  1042. if test 28618 -ne `wc -c <'parse.y'`; then
  1043.     echo shar: \"'parse.y'\" unpacked with wrong size!
  1044. fi
  1045. # end of 'parse.y'
  1046. fi
  1047. echo shar: End of archive 8 \(of 13\).
  1048. cp /dev/null ark8isdone
  1049. MISSING=""
  1050. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do
  1051.     if test ! -f ark${I}isdone ; then
  1052.     MISSING="${MISSING} ${I}"
  1053.     fi
  1054. done
  1055. if test "${MISSING}" = "" ; then
  1056.     echo You have unpacked all 13 archives.
  1057.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1058. else
  1059.     echo You still need to unpack the following archives:
  1060.     echo "        " ${MISSING}
  1061. fi
  1062. ##  End of shell archive.
  1063. exit 0
  1064.  
  1065. Chuck Musciano            ARPA  : chuck@trantor.harris-atd.com
  1066. Harris Corporation         Usenet: ...!uunet!x102a!trantor!chuck
  1067. PO Box 37, MS 3A/1912        AT&T  : (407) 727-6131
  1068. Melbourne, FL 32902        FAX   : (407) 727-{5118,5227,4004}
  1069.